Application note: the Rotation Blocks

To animate a rotation, you need to define two things: a rotation hinge and an angle variation curve. The combination of both is called an animation block.


The rotation hinge

Look at a door: it is rotating around an axis which is aligned with the door hinges. Think of the rotation as if it is a door. The AD2K2 rotation hinge operates as the hinges of this virtual door. The moving part rotates around the axis defined by the AD2K2 hinge.

An AD2K2 hinge definition just requires a pair of vertices, or a vertex and a vector. In the first case, the two vertices may be thought about as the two hinges of a door. The rotation axis is aligned with the vector which joins the two vertices. In the second case, the rotation axis direction is directly defined by its three coordinates while the vertex is a point which belongs to the rotation axis. Both kinds of hinge (the twin hinge or the vector based one) are equivalent.

Defining an AD2K2 hinge is quite easy. Select the Utilities/Define a hinge menu option. A temporary panel is displayed. You need to select a vertex to initialize the hinge capture. It is either the first of the two vertices of a twin hinge or the basic vertex of a vector based hinge. Validate by clicking on the small OK button. Then you can either enter the three coordinates of a vector or select another vertex. Validate again: that's it!

Tip: The animation of the ailerons, the rudder, the elevators and the flaps also use the hinge concept to define the axis around which the related fin is geared. This a new feature of AD2K2: AD2000 fin animation was based on a cascade of translation/rotation instructions.

Tip: The propeller rotation and the wheel rotation are still relying on an AD2000-like vector based transformation. The propeller axis is supposed to be parallel to the Oy axis and the wheel axis is supposed to be parallel to the Ox axis. The vector instruction purpose is to define the location of the center of rotation, an information which is needed by the FS viewer.
Yet, there is a difference between the AD2K2 prop and wheel animation and the AD2000 one. AD2000 required you to move the props and wheels in order to align them with the Oy or Ox axis, perform the animation and then move back the props and wheels to their initial location. AD2K2 takes the back and forth translation in charge.


The angle curve

An animation is associated with an action (gear retraction, spoiler deployment...) the duration of which is depending upon the flight model or the configuration file of your aircraft. Whatever the duration, the FS viewer acts as if it is a 200 step motion. If the total duration is two seconds, a step takes 1/100 second. If it is one second, a step takes 1/200 second. The new FS standard allows you to accurately define the position of the moving part all along these 200 steps. You can do that with a curve:
    x = f(key)
with the variable key figuring the step. If the animation is a rotation, it is an angle curve: alpha = f(key).

To set up an angle curve, you need to be in the animation block editor. While in the Model Tree Editor, insert an animation node (or select an existing one) and click on the properties button. The animation block editor is displayed.

The animation block editor is composed of several sub-panels. The general sub-panel arrangement depends on the kind of block you are working on: an undefined block, a translation block or a rotation block. In the three cases, the second sub-panel allows you to select an existing block or to create a new one.

1st sub-panel 2nd sub-panel 3rd sub-panel 4th sub-panel 5th sub-panel
undefined block associated part block
creation/selection
     
rotation block associated part block
creation/selection
angle curve
creation/selection
hinge selection  
translation block associated part block
creation/selection
x curve
creation/selection
y curve
creation/selection
z curve
creation/selection

Let us create a new block. Click on the new button in the second sub-panel. Enter a block name into the dedicated data input field (MYROT is suitable for the training). Select the rotation block radio button just below and validate.

The animation block editor is updated to display the rotation block dedicated sub-panels:

  • the angle curve selection/creation sub-panel,
  • the hinge selection sub-panel.
It is assumed that there is no existing curve and that we have to create one. If there are some, it is possible to select one of them in the combo-box of the angle curve sub-panel. To create a new curve, click on the new button and enter a curve name (let's go for MYCURVE). Validate. The default curve is a simple line. To modify it, click on the edit button. The curve editor panel is now displayed.

In the right sub-panel, there is an array which displays the curve building points. At the moment, there are just two of them. Select one of them and click on the modify button. Enter a new value or click somewhere in the curve display window. Look at the result and validate if you are happy with it.

You can also insert new building points. Select the second row of the right sub-panel array and click on the insert button. Enter the coordinates of the new buiding point in the dedicated input fields at the left of the panel or click somewhere in the curve display window. A new point is added. The curve now looks like a zig-zag. Play with the align tangent buttons to smooth the curve shape. Validate when you are happy with it. Exit the curve editor panel by clicking on the OK button. The small curve display window of the angle curve creation/selection sub-panel is updated to reflect the new curve definition.

Tip: You can modify the scale of the curve display window by unchecking the autoscale check-box and by entering the ymin and ymax values you want in the dedicated input data fields.

By the way, you can go back to the curve editor whenever you want. From the animation block editor, select MYROT in the block creation/selection sub-panel and then MYCURVE in the angle curve creation/selection sub-panel. Click on the edit button to launch the curve editor again.


An example : animation of a gear

Let us review what to do to achieve the animation of a center gear. It is assumed that the CGEAR sub-assy is representing the gear 3-D model in the deployed position. It is also assumed that it is rotating backward when the gear is retracting. The rotation axis is supposed to go through a point located on the top of the gear, for instance :
     x =  0.000
     y =  4.000
     z = -1.000

The rotation axis is parallel to the Ox axis.

To perform this animation, we shall use an animation node. An animation node requires an angle curve and a hinge.

First step: is there an existing vertex that can support the hinge ?
Any vertex with y = 4.000 and z = -1.000 can do the job. If there is one, go to the second step. If not, create a triangle with a vertex located at :

     x =  0.000
     y =  4.000
     z = -1.000

Give it the hidden attribute.

Second step: define the hinge.
Select the Utilities/Define a hinge menu option of the Graphic Editor. Select the :

     x =  0.000
     y =  4.000
     z = -1.000

vertex and validate. Enter :

     vx = 1.000
     vy = 0.000
     vz = 0.000

into the vector input data fields of the hinge temporary panel and validate.

Third step: insert an animation node.
Open the the Model Tree Editor, select the root node and click on the add button. Select the animation option and validate.

Fourth step: create an animation block.
In the Model Tree Editor, select the animation node you have just created and launch the animation block editor by clicking on the properties button. Select then the center gear option in the left sub-panel. Click on the new button in the block creation/selection sub-panel. Enter a name (CGEAR, for instance) and select the rotation block radio button. Validate. The animation block editor window is updated.

Fifth step: select the hinge.
Click on the small blue button of the hinge selection sub-panel. As we have just defined the appropriate hinge, it is automatically selected.

Sixth step: create an angle curve.
Click on the new button in the curve selection sub-panel of the animation block editor. Enter a name (GEARANG, for instance). Validate.

Seventh step: define the angle curve.
Click on the edit button in the curve selection sub-panel of the animation block editor. The curve editor is displayed. The default option is a flat curve. Select the second row in the array at the right of the curve editor window. Click on the insert button. Enter the parameters of a new point in the input sub-panel at the left-bottom of the window :

     key =   100
     alpha =   0

Validate. Now select the first row in the array: it is dedicated to the first point of the curve. Click on the modify button. Enter

     alpha =  90
into the appropriate data field in the left bottom sub-panel. Validate. The curve is now composed of two segments:

Exit the curve editor and the animation block editor by clicking twice on OK. This is it!

Why did we do that?
The zero key is pointing at the fully retracted position. As the CGEAR sub-assy is representing the deployed gear, it needs to be rotated by 90 degrees to be retracted :

     key =     0
     alpha = -90

The 100 key is allocated to the deployed position. No more rotation is required :

     key =   100
     alpha =   0

The transition between the two positions is supposed to be linear. The key = 100 to key = 200 range is allocated to the suspension animation in the FS standard. No further rotation in between :

     key =   200
     alpha =   0


copyright Hervé Devred 2003